<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<div id="nifi-registry-admin-create-bucket-dialog">
    <div class="pad-bottom-md" fxLayout="row" fxLayoutAlign="space-between center">
        <mat-card-title class="ellipsis">
            New Bucket
        </mat-card-title>
        <button mat-icon-button (click)="cancel()">
            <mat-icon color="primary">close</mat-icon>
        </button>
    </div>
    <div fxLayout="column" fxLayoutAlign="space-between start" class="pad-bottom-md">
        <div class="fill-available-width">
            <mat-form-field floatLabel="always" fxFlex>
                <input #newBucketName matInput floatPlaceholder="always" placeholder="Bucket Name">
            </mat-form-field>
        </div>
        <div class="fill-available-width">
            <mat-form-field floatLabel="always" fxFlex>
                <input #newBucketDescription matInput floatPlaceholder="always" placeholder="Description">
            </mat-form-field>
        </div>
        <mat-checkbox #newBucketPublicReadCheckbox [disabled]="protocol === 'http:'" >
            Make publicly visible<i matTooltip="Allows read access to items in this bucket by unauthenticated users. Overrides any specific policies granting read access."
                                    class="pad-left-sm fa fa-question-circle-o help-icon"></i>
        </mat-checkbox>
        <mat-checkbox [(ngModel)]="keepDialogOpen">
            Keep this dialog open after creating bucket
        </mat-checkbox>
    </div>
    <div fxLayout="row">
        <span fxFlex></span>
        <button (click)="cancel()" color="fds-regular" mat-raised-button
                i18n="Cancel creation of new bucket|A button for cancelling the creation of a new bucket in the registry.@@nf-admin-workflow-cancel-create-bucket-button">
            Cancel
        </button>
        <button [disabled]="newBucketName.value.length === 0" class="push-left-sm" data-automation-id="create-new-bucket-button"
                (click)="createBucket(newBucketName, newBucketDescription, newBucketPublicReadCheckbox)"
                color="fds-primary" mat-raised-button i18n="Create new bucket button|A button for creating a new bucket in the registry.@@nf-admin-workflow-create-bucket-button">
            Create
        </button>
    </div>
</div>
